/**
 * @author Morten Tranberg Hansen (mth@daimi.au.dk)
 * @date   August 28 2008
 */

#include "EnergyMeasurement.h"

#define __msp430x16x

configuration EnergyMeasurementC {


} implementation {

	components EnergyMeasurementP as Energy;

	components 
		new TimerMilliC(), // TODO: remove this, only there to get rid of stupid compiler warnings.
		MainC,
		new StateC(),
		BusyWait32khzC as Wait32,
		Counter32khz32C as Counter,
		LedsC;
	
//	Energy.Timer -> TimerMilliC;
	
	//MainC.SoftwareInit -> Energy;
	Energy.Boot -> MainC;
	Energy.State -> StateC;
	Energy.Wait -> Wait32;
	Energy.Counter -> Counter;
	Energy.Leds -> LedsC;

	components
		PlatformSerialC;

	Energy.UartControl -> PlatformSerialC;
	Energy.UartStream -> PlatformSerialC;

/*	components HplMsp430GeneralIOC as GeneralIOC;
	components new Msp430GpioC() as UserButtonC;
  	UserButtonC -> GeneralIOC.Port27;
  	Energy.Test -> UserButtonC;*/

	components
		HplEMPinsC as Pins,
		HplEMInterruptC as Interrupt;

	/***** Interrupts *****/
	Energy.ShiftInterrupt -> Interrupt.GIO1;
	
	/***** Input Pins *****/
	// They refer to the same pin, so we only use one, but sets both as input.
	Energy.Shift -> Pins.GIO1;
	Energy.Shift2 -> Pins.ADC2;

	Energy.ADC6 -> Pins.ADC6;
	Energy.ADC7 -> Pins.ADC7;
	Energy.ADC3 -> Pins.ADC3;
	Energy.I2C_SCL -> Pins.I2C_SCL;
	Energy.I2C_SDA -> Pins.I2C_SDA;
	Energy.GIO0 -> Pins.GIO0;

	/***** Output Pins *****/
	Energy.Charge1 -> Pins.URXD0;
	Energy.Charge2 -> Pins.UTXD0;
	Energy.Use1 -> Pins.ADC0;
	Energy.Use2 -> Pins.ADC1;
	
	Energy.UsbControl -> Pins.GIO2;

}
